package com.endpoint.member.controller;

import com.endpoint.common.bean.UserDetails;
import com.endpoint.common.utils.ResultBean;
import com.endpoint.member.service.LoginService;
import com.endpoint.member.vo.MemberLoginVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @Project: endpoint
 * @Name: MemberLoginController
 * @Author: Jack_Li
 * @Date: 2024/7/6 10:29
 */
@RestController
@RequestMapping("/member/login")
public class MemberLoginController {

    @Autowired
    private LoginService loginService;
    @ApiOperation(value = "用户登录")
    @PostMapping
    public ResultBean register(@Valid @RequestBody MemberLoginVo loginVo){
        UserDetails userDetails = loginService.Login(loginVo);
        return ResultBean.ok(userDetails);
    }

}
